#include "CommonUtils.h"
#include <time.h>
#include <ctime>

void ConvertDateTimeToISO8601Ansi(time_t value, char* destination, size_t length)
{
	tm* time = gmtime(&value);
	if (time == NULL)
		destination[0] = '\x0';
	else
		strftime(destination, length, "%Y-%m-%dT%H:%M:%S.000Z", time);
}

#ifdef WIN32
string GetCurrentUserName()
{
	char buffer[512];
	DWORD cbSize = 511;
	GetUserName(buffer, &cbSize);
	return buffer;
}
#else
#error no GetCurrentUserName function defined for this platform
#endif
